import request from "../utils/request";

// 登录
export function login(loginCode, password) {
    let data = {
      loginCode:loginCode,
      password:password
  }
  return request({
    url: "/users/signin",
    method: "post",
    data:data
  });
}

// 登录
export function register(loginCode, password,name,studentNum,roles) {
  let data = {
    loginCode:loginCode,
    password:password,
    name:name,
    studentNum:studentNum,
    roles:roles
}
return request({
  url: "/users/signup",
  method: "post",
  data:data
});
}

//修改密码（用户）
export function reset(loginCode, password) {
  let data = {
    loginCode:loginCode,
    password:password
}
return request({
  url: "/users/password/client",
  method: "put",
  data:data
});
}

//修改密码（管理员）
export function resetbyadmin(loginCode, password) {
  let data = {
    loginCode:loginCode,
    password:password
}
return request({
  url: "/users/password/admin",
  method: "put",
  data:data
});
}



